package com.park.manage.controller;

import com.github.pagehelper.PageInfo;
import com.park.controller.BaseController;
import com.park.entity.page.PageInfoParm;
import com.park.entity.park.ParkInfo;
import com.park.entity.park.ParkInfoItem;
import com.park.manage.service.park.ManageParkService;
import com.park.response.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Administrator
 * @title: ParkManagerController
 * @projectName park
 * @description: 停车场管理
 * @date 2020/5/510:17
 */
@RestController
@RequestMapping(value = "/wx/manage/park")
public class ParkManagerController extends BaseController {

    @Autowired
    private ManageParkService manageParkService;

    //停车场添加
    @RequestMapping(value = "/add",method = RequestMethod.POST)
    public Result add(@RequestBody ParkInfo parkInfo){
        manageParkService.addParkInfo(parkInfo);
        return SUCCESS();
    }

    //停车场列表
    @RequestMapping(value = "/list",method = RequestMethod.POST)
    public Result list(@RequestBody PageInfoParm pageInfoParm){
        PageInfo<ParkInfoItem> pageInfo = manageParkService.list(pageInfoParm);
        return SUCCESS(pageInfo);
    }

}
